<?PHP
  $current_page = "register.php";
  $page_type = "";
  require_once 'header.php';
?>

<div id="page">
	  <div id="page-padding">
        <!-- start content -->	    
	    <div id="content">
	      <div id="content-padding">
            <h1>Registration Receipt</h1>
            <?PHP  
              // Get the form fields value
              $input_user_id = trim($_SESSION['input_user_id']);
              $input_password = trim($_SESSION["input_password"]);
              $input_fname = trim($_SESSION['input_fname']);
              $input_lname = trim($_SESSION['input_lname']);
              $input_email = trim($_SESSION['input_email']);
              $input_vflag = 'y';  // Default is volunteer account	
			  
              // Form the insertion sql string and run it
			  // Create new volunteer account
              $sql = "insert into USER_ACCT (UserId, Password, Fname, Lname, Email, VFlag) 
                      values ('$input_user_id','$input_password','$input_fname','$input_lname','$input_email', '$input_vflag')";

              $result_array = execute_sql_in_oracle($sql);
              $result = $result_array["flag"];
              $cursor = $result_array["cursor"];

              if (!$result) {
                $register_error = "New user creation failed. Try again.";
                header("Location:register.php?register_error=$register_error");
              }
              else {
                // Record inserted, reset form field variable sessions and redirect to index.php
                resetForm();
	            echo ("<p> Congratulation! Your account(<b>$input_user_id</b>) has been successfully created!");
              }
            ?>
            <p>&nbsp; </p>
	      </div>
		</div>
	  <!-- end content --></div>
	  <div id="footer">
	    <div id="footer-pad">
	      <div class="line"></div>
		  <!-- footer and copyright notice -->
	      <p>Design by <a href="http://www.steves-templates.com">Steve's free website templates</a>.</p>
		  <!-- end footer and copyright notice -->
	    </div>
	  </div>
	</div>
  </body>
</html>